#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>

int main(int argc, char **argv)
{
	int fd;
	char *p = "/dev/third_dev";
	unsigned char key_vals;

	fd = open(p, O_RDWR);
	if (fd < 0) {
		printf("can't open %s\n", p);
	}

	while (1) {
		read(fd, &key_vals, 1);
		printf("key_val = 0x%x\n", key_vals);		
	}
	
	return 0;
}

